package com.ctrip.ec.api.mobile.interceptor;

import com.ctrip.ec.api.mobile.common.ValidateException;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.annotation.Annotation;

/**
 * Created by jiang on 2018/9/23.
 */
public class AuthInterceptor extends HandlerInterceptorAdapter {
    @Override
    public boolean preHandle(HttpServletRequest request,
                             HttpServletResponse response, Object handler) throws Exception {
//        Object obj = handler;
//        System.out.println(obj.getClass().getName());
//        HandlerMethod m = (HandlerMethod)handler;
//        Annotation a = m.getMethod().getAnnotation(MemberAuth.class);
//        System.out.println("interceptor");
//        if(a != null){
//            System.out.println("ok");
//           // throw  new ValidateException("error");
//            //return true;
//        }
       return true;
    }
}

